<div style="height:auto;width:100%">
<table  id="fmfrmroomtype_tblmain" width="100%">
<tr>
<td valign="top" class="width25">
<div class="divLeft" style="overflow:auto;width:100%">

<table class="info width100" id="fmfrmroomtype_tblinfo" >

<tr><td>
<div id="frmmenu_divleft" class="divleft">


<table class="width100 tbltranparents">
<tr >
<td  class="lblRequired width30">Loại Phòng:</td>
<td colspan="3"><input maxlength="30"  type="text"  id="fmfrmroomtype_txtnametype" class="txtRequired"/></td>
</tr>
 <tr >
<td  class="lblRequired" colspan="3">Tiền giờ tối thiểu khi thuê phòng:</td>
<td colspan="1"><input  type="text" value="0"  id="fmfrmroomtype_txtminmoney" maxlength="8" class="txtRequired isNumber txtTien"/></td>
</tr>
<tr >
<td  class="lblRequired">Lập TG</td>
<td colspan="3"><div id="fmfrmroomtype_slider" class="width100"></div></td>
</tr>
<tr >
<td  class="lblRequired" >Khoảng TG </td>
<td id="fmfrmroomtype_tdtime-1" width="23%">0h-6h</td> <td  width="23%" id ="fmfrmroomtype_tdtime-2">6h-18h</td>
 <td width="24%" id="fmfrmroomtype_tdtime-3">18h-24h</td>
</tr>
 
<tr >
<td ><button class="fm_clscopydown" id="fmfrmroomtype_copy-1" onclick="fmfrmroomtype_copy(1)">Copy</button>&nbsp;T2</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-1-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-1-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-1-3"></td>
</tr>
<tr >
<td ><button class="fm_clscopydown" id="fmfrmroomtype_copy-2" onclick="fmfrmroomtype_copy(2)">Copy</button>&nbsp;T3</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-2-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-2-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-2-3"></td>
</tr>
<tr >
<td ><button class="fm_clscopydown" id="fmfrmroomtype_copy-3" onclick="fmfrmroomtype_copy(3)">Copy</button>&nbsp;T4</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-3-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-3-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-3-3"></td>
</tr>
<tr >
<td ><button class="fm_clscopydown" id="fmfrmroomtype_copy-4" onclick="fmfrmroomtype_copy(4)">Copy</button>&nbsp;T5</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-4-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-4-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-4-3"></td>
</tr>
<tr >
<td ><button class="fm_clscopydown" id="fmfrmroomtype_copy-5" onclick="fmfrmroomtype_copy(5)">Copy</button>&nbsp;T6</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-5-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-5-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-5-3"></td>
</tr>
<tr >
<td ><button class="fm_clscopydown" id="fmfrmroomtype_copy-6" onclick="fmfrmroomtype_copy(6)">Copy</button>&nbsp;T7</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-6-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-6-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-6-3"></td>
</tr>
<tr >
<td >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CN</td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-0-1"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-0-2"></td>
<td><input type="text" maxlength="9" class="isNumber txtRequired txtTien" id="fmfrmroomtype_txtprice-0-3"></td>
</tr>
<tr >
<td  class="lblRequired" rowspan="4">Màu sắc</td> 

<td > <input type="radio" value="1" name="fmfrmroomtype_cbbstyle" checked="checked" id="fmfrmroomtype_cbbstyle-1"></td>
<td colspan="2"><div class="fm_clsRoomTitle fm_clsTittleOn fm_divchair-1">001</div></td>

</tr>
<tr >
<td > <input type="radio" value="2" name="fmfrmroomtype_cbbstyle" id="fmfrmroomtype_cbbstyle-2"></td>
<td colspan="2"><div class="fm_clsRoomTitle fm_clsTittleOn fm_divchair-2">002</div></td>

</tr>
<tr >
<td > <input type="radio" value="3" name="fmfrmroomtype_cbbstyle" id="fmfrmroomtype_cbbstyle-3"></td>
<td colspan="2"><div class="fm_clsRoomTitle fm_clsTittleOn fm_divchair-3">003</div></td>

</tr>

<tr >
<td > <input type="radio" value="4" name="fmfrmroomtype_cbbstyle" id="fmfrmroomtype_cbbstyle-4"></td>
<td colspan="2"><div class="fm_clsRoomTitle fm_clsTittleOn fm_divchair-4">004</div></td>
</tr>
 
</table>

<input type="hidden" value="6" id="fmfrmroomtype_low">
<input type="hidden" value="18" id="fmfrmroomtype_high">

    <div class="divactionbuton">



        <button class="save validate btnsave" id="fmfrmroomtype_submit" type="button"> Thêm Mới </button> <button  type="reset" id="fmfrmroomtype_clear" class="clear">

        <input type="hidden" id="fmfrmroomtype_hdEdit" value="0"/>
        <input type="hidden" id="fmfrmroomtype_hdId" value=""/>
    </div>

 </div>
</td></tr>
<tr >
<td >

</td>
</tr>
</table>

</div>

</td>
<td class="clsmiddle"></td>
<td height="400" valign="top" align="center"><div id="fmfrmroomtype_divGrid" class="divGrid"></div></td>
<td class="clsend"></td>
</tr>
</table>
</div>
<script language="javascript">
$(document).ready(function () {
    initForm('fmfrmroomtype_tblinfo');
    initDivleft();
    $( "#fmfrmroomtype_slider" ).slider({
            range: true,
            min :0,
            max :24,
            values :[ 6, 18 ],
            slide :function( event, ui ) {
                
                $( "#fmfrmroomtype_tdtime-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
                $( "#fmfrmroomtype_tdtime-2" ).html(  ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
                $( "#fmfrmroomtype_tdtime-3" ).html(  ui.values[ 1 ] + "h -" + "24h");
                $('#fmfrmroomtype_low').val(ui.values[ 0 ]);
                $('#fmfrmroomtype_high').val(ui.values[ 1 ]);
            }
        });
            //$( "#fmfrmroomtype_slider-2" ).slider({
//            range :true,
//            min :0,
//            max :24,
//            values: [ 6, 18 ],
//            slide :function( event, ui ) {
//                $( "#fmfrmroomtype_tdtime-2-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
//                $( "#fmfrmroomtype_tdtime-2-2" ).html( ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
//                $( "#fmfrmroomtype_tdtime-2-3" ).html(  ui.values[ 1 ] + "h -" + "24h");
//                $('#fmfrmroomtype_low-2').val(ui.values[ 0 ]);
//                $('#fmfrmroomtype_high-2').val(ui.values[ 1 ]);
//            }
//        });
//            $( "#fmfrmroomtype_slider-3" ).slider({
//            range :true,
//            min :0,
//            max :24,
//            values: [ 6, 18 ],
//            slide: function( event, ui ) {
//                $( "#fmfrmroomtype_tdtime-3-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
//                $( "#fmfrmroomtype_tdtime-3-2" ).html( ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
//                $( "#fmfrmroomtype_tdtime-3-3" ).html(  ui.values[ 1 ] + "h -" + "24h");
//                $('#fmfrmroomtype_low-3').val(ui.values[ 0 ]);
//                $('#fmfrmroomtype_high-3').val(ui.values[ 1 ]);
//            }
//        });
//            $( "#fmfrmroomtype_slider-4" ).slider({
//            range :true,
//            min :0,
//            max :24,
//            values :[ 6, 18 ],
//            slide :function( event, ui ) {
//                $( "#fmfrmroomtype_tdtime-4-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
//                $( "#fmfrmroomtype_tdtime-4-2" ).html(  ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
//                $( "#fmfrmroomtype_tdtime-4-3" ).html(  ui.values[ 1 ] + "h -" + "24h");
//                $('#fmfrmroomtype_low-4').val(ui.values[ 0 ]);
//                $('#fmfrmroomtype_high-4').val(ui.values[ 1 ]);
//            }
//        });
//            $( "#fmfrmroomtype_slider-5" ).slider({
//            range :true,
//            min :0,
//            max :24,
//            values: [ 6, 18 ],
//            slide :function( event, ui ) {
//                $( "#fmfrmroomtype_tdtime-5-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
//                $( "#fmfrmroomtype_tdtime-5-2" ).html(  ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
//                $( "#fmfrmroomtype_tdtime-5-3" ).html(  ui.values[ 1] + "h -" + "24h");
//                $('#fmfrmroomtype_low-5').val(ui.values[ 0 ]);
//                $('#fmfrmroomtype_high-5').val(ui.values[ 1 ]);
//            }
//        });
//            $( "#fmfrmroomtype_slider-6" ).slider({
//            range :true,
//            min :0,
//            max :24,
//            values :[ 6, 18 ],
//            slide :function( event, ui ) {
//                $( "#fmfrmroomtype_tdtime-6-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
//                $( "#fmfrmroomtype_tdtime-6-2" ).html(  ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
//                $( "#fmfrmroomtype_tdtime-6-3" ).html(  ui.values[ 1 ] + "h -" + "24h");
//                $('#fmfrmroomtype_low-6').val(ui.values[ 0 ]);
//                $('#fmfrmroomtype_high-6').val(ui.values[ 1 ]);
//            }
//        });
//        
//        $( "#fmfrmroomtype_slider-0" ).slider({
//            range :true,
//            min: 0,
//            max :24,
//            values :[ 6, 18 ],
//            slide: function( event, ui ) {
//                $( "#fmfrmroomtype_tdtime-0-1" ).html( "0h - " + ui.values[ 0 ] + "h" );
//                $( "#fmfrmroomtype_tdtime-0-2" ).html(  ui.values[ 0 ] + "h - " + ui.values[ 1 ] + "h");
//                $( "#fmfrmroomtype_tdtime-0-3" ).html(  ui.values[ 1 ] + "h -" + "24h");
//                $('#fmfrmroomtype_low-0').val(ui.values[ 0 ]);
//                $('#fmfrmroomtype_high-0').val(ui.values[ 1 ]);
//            }
//        });
});

function fmfrmroomtype_SetSlider(sliderId,value0,value1,price1,price2,price3){
  $( "#fmfrmroomtype_slider").slider("values" , 0 ,value0);
  $( "#fmfrmroomtype_slider").slider("values" , 1 ,value1); 
  
  $( "#fmfrmroomtype_low").val(value0);
  $( "#fmfrmroomtype_high").val(value1); 
                                                                
  $( "#fmfrmroomtype_tdtime-1").html("0h - "+value0+"h");  
  $( "#fmfrmroomtype_tdtime-2").html(value0+"h - "+value1+"h");
  $( "#fmfrmroomtype_tdtime-3").html(value1+"h - 24h");
  
  $("#fmfrmroomtype_txtprice-"+sliderId+"-1").val(price1);
  $("#fmfrmroomtype_txtprice-"+sliderId+"-2").val(price2);
  $("#fmfrmroomtype_txtprice-"+sliderId+"-3").val(price3);
  
}

function fmfrmroomtype_copy(id_source){
    lowsrc = $('#fmfrmroomtype_low-'+id_source).val();
    highsrc = $('#fmfrmroomtype_high-'+id_source).val();
    time1src = $('#fmfrmroomtype_tdtime-'+id_source+"-1").html();
    time2src = $('#fmfrmroomtype_tdtime-'+id_source+"-2").html();
    time3src = $('#fmfrmroomtype_tdtime-'+id_source+"-3").html(); 
    price1src = $('#fmfrmroomtype_txtprice-'+id_source+"-1").val();
    price2src = $('#fmfrmroomtype_txtprice-'+id_source+"-2").val();
    price3src = $('#fmfrmroomtype_txtprice-'+id_source+"-3").val();
    for(i=id_source;i<8;i++){
        j= i % 7;
       $('#fmfrmroomtype_low-'+j).val(lowsrc); 
       $('#fmfrmroomtype_high-'+j).val(highsrc); 
       $('#fmfrmroomtype_tdtime-'+j+"-1").html(time1src);
       $('#fmfrmroomtype_tdtime-'+j+"-2").html(time2src);
       $('#fmfrmroomtype_tdtime-'+j+"-3").html(time3src);
       
       $('#fmfrmroomtype_txtprice-'+j+"-1").val(price1src);
       $('#fmfrmroomtype_txtprice-'+j+"-2").val(price2src);
       $('#fmfrmroomtype_txtprice-'+j+"-3").val(price3src);
       
       $( "#fmfrmroomtype_slider-" + j).slider("values" , 0 ,lowsrc);
       $( "#fmfrmroomtype_slider-" + j).slider("values" , 1 ,highsrc); 
    }
}

function addClassColor(obj){
    var csscolor = $(obj).attr('class');
    $('#fmfrmroomtype_cbbColor').removeAttr('class');
    $('#fmfrmroomtype_cbbColor').addClass(csscolor);
}
function fmfrmroomtype_resetFrm(obj){
    for(i=0;i<7;i++){
        $('#fmfrmroomtype_low-'+i).val(6);
        $('#fmfrmroomtype_high-'+i).val(18);
        $( "#fmfrmroomtype_slider-" + i).slider("values" , 0 ,6);
        $( "#fmfrmroomtype_slider-" + i).slider("values" , 1 ,18);
        
        $( "#fmfrmroomtype_tdtime-"+i+"-1").html("0h - 6h");  
        $( "#fmfrmroomtype_tdtime-"+i+"-2").html("6h - 18h");
        $( "#fmfrmroomtype_tdtime-"+i+"-3").html("18h - 24h"); 
    }
    var parent = $(obj).parents('table:eq(0)');
    $(parent).find(":text").val('');
}
xajax_fmfrmroomtype_loadGrid();
</script>